package com.example.nio.intbuffer;

import java.nio.Buffer;
import java.nio.IntBuffer;

/**
 * @author panghu
 * @version 1.0.0
 * @createTime 2023年08月05日 22:58:00
 * @Description
 */
public class RewindDemo {

    public static void main(String[] args) {
        IntBuffer buffer = IntBuffer.wrap(new int[]{1, 2, 3, 4, 5, 6, 7, 8, 9, 0});
        for (int i = 0; i < 4; i++) {
            buffer.get();
        }
        // pos = 0 ,mark = -1
        Buffer rewind = buffer.rewind();

        System.out.println(buffer.get());
    }

}
